/**
 * 
 */
package fr.gfi.agraf.persistence.entity;

import java.util.Date;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * @author eleve
 * 
 */
@Entity
public class Utilisateur {

	@Id
	@GeneratedValue
	private Long id;

	@Column(nullable = false)
	private String identifiant;

	@Column(nullable = false)
	private String motDePasse;

	@Column(nullable = false)
	private String nom;

	@Column(nullable = false)
	private String prenom;

	@Column(nullable = false)
	private String email;

	@Temporal(TemporalType.TIMESTAMP)
	private Date dateEntree;

	@Temporal(TemporalType.TIMESTAMP)
	private Date dateSortie;

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	@JoinTable(name = "assoProfilUtilisateur", joinColumns = { @JoinColumn(name = "idUtilisateur", referencedColumnName = "id") }, inverseJoinColumns = { @JoinColumn(name = "idProfil", referencedColumnName = "id") })
	private Set<Profil> profils;

	/**
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * @param id
	 *            the id to set
	 */
	public void setId(final Long id) {
		this.id = id;
	}

	/**
	 * @return the identifiant
	 */
	public String getIdentifiant() {
		return identifiant;
	}

	/**
	 * @param identifiant
	 *            the identifiant to set
	 */
	public void setIdentifiant(final String identifiant) {
		this.identifiant = identifiant;
	}

	/**
	 * @return the motDePasse
	 */
	public String getMotDePasse() {
		return motDePasse;
	}

	/**
	 * @param motDePasse
	 *            the motDePasse to set
	 */
	public void setMotDePasse(final String motDePasse) {
		this.motDePasse = motDePasse;
	}

	/**
	 * @return the nom
	 */
	public String getNom() {
		return nom;
	}

	/**
	 * @param nom
	 *            the nom to set
	 */
	public void setNom(final String nom) {
		this.nom = nom;
	}

	/**
	 * @return the prenom
	 */
	public String getPrenom() {
		return prenom;
	}

	/**
	 * @param prenom
	 *            the prenom to set
	 */
	public void setPrenom(final String prenom) {
		this.prenom = prenom;
	}

	/**
	 * @return the dateEntree
	 */
	public Date getDateEntree() {
		return dateEntree;
	}

	/**
	 * @param dateEntree
	 *            the dateEntree to set
	 */
	public void setDateEntree(final Date dateEntree) {
		this.dateEntree = dateEntree;
	}

	/**
	 * @return the email
	 */
	public String getEmail() {
		return email;
	}

	/**
	 * @param email
	 *            the email to set
	 */
	public void setEmail(final String email) {
		this.email = email;
	}

	/**
	 * @return the dateSortie
	 */
	public Date getDateSortie() {
		return dateSortie;
	}

	/**
	 * @param dateSortie
	 *            the dateSortie to set
	 */
	public void setDateSortie(final Date dateSortie) {
		this.dateSortie = dateSortie;
	}

	/**
	 * @return the profils
	 */
	public Set<Profil> getProfils() {
		return profils;
	}


}
